using System;
using System.ComponentModel;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ApiTest2.Entitys
{
    /// <summary>
    /// 操作日志
    /// </summary>  
    /// <remarks>
    /// <![CDATA[ENGINE=InnoDB  COMMENT='操作日志']]>
    /// </remarks>
    [DbSource("Default"), Serializable]
    public class LogOperation
    {
        /// <summary>
        /// id
        /// </summary>
        /// <remarks>
        /// <![CDATA[bigint NOT NULL COMMENT '']]>
        /// </remarks>
        [Primary(Automatic = true)]
        public long Id { get; set; }

        /// <summary>
        /// 模块
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(64) DEFAULT NULL COMMENT '模块']]>
        /// </remarks>
        [Column(64)]
        [DisplayName("模块")]
        public string ModuleName { get; set; }

        /// <summary>
        /// 表名
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(64) DEFAULT NULL COMMENT '表名']]>
        /// </remarks>
        [Column(64)]
        [DisplayName("表名")]
        public string TableName { get; set; }

        [JsonConverter(typeof(AutoEnumConverter))]
        public OperationTypeEnum OperationTypeName => (OperationTypeEnum)OperationType;

        /// <summary>
        /// 操作 [新增=1,修改=2,新增或修改=3,删除=4,其他=8]
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '操作 [新增=1,修改=2,新增或修改=3,删除=4,其他=8]']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("操作")]
        public int OperationType { get; set; }

        /// <summary>
        /// admin_id
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '']]>
        /// </remarks>
        [Column(false)]
        public int AdminId { get; set; }

        /// <summary>
        /// 操作信息
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(512) DEFAULT NULL COMMENT '操作信息']]>
        /// </remarks>
        [Column(512)]
        [DisplayName("操作信息")]
        public string Information { get; set; }

        /// <summary>
        /// create_date
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '']]>
        /// </remarks>
        [Column(false)]
        public int CreateDate { get; set; }

        /// <summary>
        /// create_time
        /// </summary>
        /// <remarks>
        /// <![CDATA[datetime NOT NULL COMMENT '']]>
        /// </remarks>
        [Column(false)]
        public DateTime CreateTime { get; set; }

    }
}
